home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / Obrn-A_1.6_lib.lha / oberon-a / source3.lha / source / AmigaUtil / ASLUtil.mod < prev    next >
Text File  |  1995-06-29  |  1KB  |  60 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: ASLUtil.mod $
  4.   Description: Support for clients of asl.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:18:08 $
  10.  
  11.   Copyright © 1994, Frank Copeland.
  12.   This file is part of the Oberon-A Library.
  13.   See Oberon-A.doc for conditions of use and distribution.
  14.  
  15. *************************************************************************)
  16.  
  17. <* STANDARD- *>
  18.  
  19. MODULE ASLUtil;
  20.  
  21. IMPORT SYS := SYSTEM, u := Utility, i := Intuition, ASL;
  22.  
  23. (*------------------------------------*)
  24. (*
  25.   Simple wrapper for calling the ASL FileRequester.
  26. *)
  27.  
  28. PROCEDURE RequestFile * (
  29.   window        : i.WindowPtr;
  30.   hail          : ARRAY OF CHAR;
  31.   VAR file      : ARRAY OF CHAR;
  32.   VAR directory : ARRAY OF CHAR )
  33. : BOOLEAN;
  34.  
  35.   VAR
  36.     fr : ASL.FileRequesterPtr; result : BOOLEAN;
  37.  
  38. <*$CopyArrays-*>
  39. BEGIN (* RequestFile *)
  40.   fr := SYS.VAL (ASL.FileRequesterPtr,
  41.     ASL.AllocAslRequestTags
  42.       ( ASL.fileRequest,
  43.         ASL.hail,   SYS.ADR (hail),
  44.         ASL.window, window,
  45.         ASL.file,   SYS.ADR (file),
  46.         ASL.dir,    SYS.ADR (directory),
  47.         u.end ));
  48.   IF fr # NIL THEN
  49.     result := ASL.AslRequestTags (fr, u.end);
  50.     IF result THEN COPY (fr.drawer^, directory); COPY (fr.file^, file) END;
  51.     ASL.FreeAslRequest (fr)
  52.   ELSE
  53.     result := FALSE
  54.   END;
  55.   RETURN result
  56. END RequestFile;
  57.  
  58. END ASLUtil.
  59.  
  60.